<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
  
  <head>
    
    <%@ include file="/WEB-INF/include/meta.jsp"%>
    <%@ include file="/WEB-INF/include/css.jsp"%>
    
  </head>
  <!-- end header -->
  <body>
    <div class="page-group">
      <div class="page page-current">
        
        <header class="bar student-bar">
          <a href="${ctx.host}/students/${student.id}" class="icon icon-left pull-left back"></a>
          <h1 class="student-title">批量排课</h1>
        </header>

        <div class="content" style="top: 2.2rem;">
          
          <form action="${ctx.host}/students/${student.id}/rounds/${courseRound.id}/arrange" method="POST" data-redirect="${ctx.host}/students/${student.id}">
            
            <input type="hidden" name="_method" value="PATCH">
            
            <div class="list-block" style="margin-bottom: 0px;">
            
              <ul>
                <!-- Text inputs -->
                <li>
                  <div class="item-content">
                    <div class="item-inner">
                      <div class="item-input">
                        <input name="beginDate" type="text" class="text-center bg-white" data-toggle='date' placeholder="请选择课程开始日期">
                      </div>
                    </div>
                  </div>
                </li>
              </ul>
            </div>
            
            <c:set var="max" value="${courseRound.course.hours/courseRound.course.weeks}"></c:set>
            
            <c:forEach begin="0" end="${max - 1}">
              
              <div class="list-block">
                <ul>
                <!-- Text inputs -->
                  <li>
                    <div class="item-content">
                      <div class="item-inner">
                        <div class="item-input">
                          <input type="text" class="text-center" placeholder="选择周几与具体时间段" name="dayhour-select" value="" readonly/>
                          <input type="hidden" name="dayhours">
                        </div>
                      </div>
                    </div>
                  </li>
                </ul>
              </div>
              
            </c:forEach>
            
            <div class="content-block">
              <p><a href="javascript:void(0);" data-shift-submit="true" class="button button-big button-success ft-button">提交预约 </a></p>
            </div>
          
          </form>
          
        </div>
        
      </div>
    </div>
    
    <%@ include file="/WEB-INF/include/script.jsp"%>
    <d:resource type="script" root="${ctx.resource}/build" src="js/page/student/arrange.js">
    <script type="text/javascript">
      require(['page/student/arrange'], function(page) {
        page.init({
        	beginDate: "${beginDate}",
          studentId: "${student.id}",
          single: false
        })
      })
    </script>
    </d:resource>
    
  </body>
</html>